<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:thSys="">
<!-- 顶部栏 -->
<head>
    <title>后台首页</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" th:href="@{/img/favicon.ico}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/plugins/bootstrap/css/bootstrap.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/plugins/vali/css/main.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/plugins/font-awesome-4.7.0/css/font-awesome.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/plugins/toast/jquery.toast.css}">
    <link rel="stylesheet" th:href="@{/plugins/simplemde/simplemde.min.css}">
    <link rel="stylesheet" th:href="@{//cdn.jsdelivr.net/highlight.js/latest/styles/github.min.css}">
    <link rel="stylesheet" th:href="@{/plugins/bootstrap-fileinput/css/fileinput.min.css}">
    <link rel="stylesheet" th:href="@{/css/attachment.css}">
</head>
<body class="app sidebar-mini rtl">
<main class="app-content">
    <header class="app-header"><a class="app-header__logo" href="/admin">Mayday</a>
        <a class="app-sidebar__toggle" href="#" data-toggle="sidebar" aria-label="Hide Sidebar"></a>
        <ul class="app-nav">
            <a class="app-nav__item" href="/user/index" th:target="_blank"  aria-label="Show notifications"><i class="fa fa-paper-plane fa-lg"></i></a>
            <li class="dropdown"><a class="app-nav__item" href="#" data-toggle="dropdown" aria-label="Open Profile Menu"><i class="fa fa-user fa-lg"></i></a>
                <ul class="dropdown-menu settings-menu dropdown-menu-right">
                    <li><a class="dropdown-item" href="/admin/profile"><i class="fa fa-user fa-lg"></i> 个人资料</a></li>
                    <li><a class="dropdown-item" href="/user/logout"><i class="fa fa-sign-out fa-lg"></i> 退出</a></li>
                </ul>
            </li>
        </ul>
    </header>
    <div>
        <!-- Navbar-->
        <!-- 侧边栏-->
        <div class="app-sidebar__overlay" data-toggle="sidebar"></div>
        <aside class="app-sidebar">
            <div class="app-sidebar__user"><img width="60px" class="app-sidebar__user-avatar" th:src="${user.getIcon()}" alt="User Image">
                <div>
                    <p class="app-sidebar__user-name" th:text="${user.getRealname()}" ></p>
                </div>
            </div>
            <ul class="app-menu">
                <li><a class="app-menu__item" href="/admin"><i class="app-menu__icon fa fa-dashboard"></i><span class="app-menu__label">仪表盘</span></a></li>
                <li class="treeview"><a class="app-menu__item" href="#" data-toggle="treeview"><i class="app-menu__icon fa fa-book"></i><span class="app-menu__label">日记</span><i class="treeview-indicator fa fa-angle-right"></i></a>
                    <ul class="treeview-menu">
                        <li><a class="treeview-item" href="/admin/article"><i class="icon fa fa-circle-o"></i>所有日记</a></li>
                        <li><a class="treeview-item" href="/admin/article/new"><i class="icon fa fa-circle-o"></i>写日记</a></li>
                    </ul>
                </li>
                <li class="treeview"><a class="app-menu__item" href="#" data-toggle="treeview"><i class="app-menu__icon fa fa-file-text-o"></i><span class="app-menu__label">页面</span><i class="treeview-indicator fa fa-angle-right"></i></a>
                    <ul class="treeview-menu">
                        <li><a class="treeview-item" href="/admin/page"><i class="icon fa fa-circle-o"></i>所有页面</a></li>
                        <li><a class="treeview-item" href="/admin/page/new"><i class="icon fa fa-circle-o"></i>新建页面</a></li>
                    </ul>
                </li>
                <li><a class="app-menu__item" href="/admin/attachment"><i class="app-menu__icon fa fa-file-image-o"></i><span class="app-menu__label">附件</span></a></li>
                <!--         <li><a class="app-menu__item" href="charts.html"><i class="app-menu__icon fa fa-comments"></i><span class="app-menu__label">评论</span></a></li> -->
                <li class="treeview"><a class="app-menu__item" href="#" data-toggle="treeview"><i class="app-menu__icon fa fa-paint-brush"></i><span class="app-menu__label">外观</span><i class="treeview-indicator fa fa-angle-right"></i></a>
                    <ul class="treeview-menu">
                        <li><a class="treeview-item" href="/admin/menus"><i class="icon fa fa-circle-o"></i>菜单</a></li>
                    </ul>
                </li>
                <li class="treeview"><a class="app-menu__item" href="#" data-toggle="treeview"><i class="app-menu__icon fa fa-user-circle"></i><span class="app-menu__label">用户</span><i class="treeview-indicator fa fa-angle-right"></i></a>
                    <ul class="treeview-menu">
                        <li><a class="treeview-item" href="/admin/profile"><i class="icon fa fa-circle-o"></i>个人资料</a></li>
                    </ul>
                </li>
            </ul>
        </aside>
    </div>
    <div class="app-title">
        <div>
            <h1><i class="fa fa-dashboard"></i> 仪表盘</h1>
            <p>欢迎使用私密空间</p>
        </div>
        <ul class="app-breadcrumb breadcrumb">
            <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
            <li class="breadcrumb-item"><a href="#">仪表盘</a></li>
        </ul>
    </div>
    <div class="row">
        <div class="col-md-6 col-lg-3">
            <div class="widget-small primary coloured-icon"><i class="icon fa fa-book fa-3x"></i>
                <div class="info">
                    <h4>我们的日记</h4>
                    <p><b th:text="${countPublishAll}"></b></p>
                </div>
            </div>
        </div>
        <div class="col-md-6 col-lg-3">
            <div class="widget-small info coloured-icon"><i class="icon fa fa-link fa-3x"></i>
                <div class="info">
                    <h4>我写的日记</h4>
                    <p><b th:text="${countPublishSelf}"></b></p>
                </div>
            </div>
        </div>
        <div class="col-md-6 col-lg-3">
            <div class="widget-small warning coloured-icon"><i class="icon fa fa-file-image-o fa-3x"></i>
                <div class="info">
                    <h4>我们的照片</h4>
                    <p><b th:text="${countAttachment}"></b></p>
                </div>
            </div>
        </div>
        <div class="col-md-6 col-lg-3">
            <div class="widget-small danger coloured-icon"><i class="icon fa fa-star fa-3x"></i>
                <div class="info">
                    <h4>我们的时间</h4>
                    <p><b th:text="${establishDate}"></b></p>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-6 col-md-12">
            <div class="tile">
                <h3 class="tile-title">最新日记</h3>
                <table class="table">
                    <tr>
                        <td>标题</td>
                        <td>状态</td>
                        <td>时间</td>
                    </tr>
                    <tr th:each="article : ${articles}">
                        <td><a th:text="${article.getTitle()}" target="_blank" th:title="${article.getTitle()}" th:href="'/user/post/'+${article.getUrl()}"></a></td>
                        <td th:switch="${article.getStatus()}">
                            <th:block th:case="0">
                                <span class="badge badge-success">已发布</span>
                            </th:block>
                            <th:block th:case="1">
                                <span class="badge badge-info">草 稿</span>
                            </th:block>
                            <th:block th:case="2">
                                <span class="badge badge-danger">回收站</span>
                            </th:block>
                        </td>
                        <td th:text="${#dates.format(article.getNewstime(),'yyyy/MM/dd HH:mm:ss')}"></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="row">
    </div>
</main>
<script type="text/javascript" src="/static/plugins/layer/layer.js"></script>
<script type="text/javascript" th:src="@{/plugins/vali/js/jquery-3.2.1.min.js}"></script>
<script type="text/javascript" th:src="@{/plugins/vali/js/popper.min.js}"></script>
<script type="text/javascript" th:src="@{/plugins/vali/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/plugins/vali/js/main.js}"></script>
<script type="text/javascript" th:src="@{/plugins/vali/js/plugins/pace.min.js}"></script>
<script type="text/javascript" th:src="@{/js/mayday.js}"></script>
<script type="text/javascript" th:src="@{/plugins/toast/jquery.toast.js}"></script>
</body>
</html>